package com.power.sifa.net.api;

import com.plf.common.domain.ResponseDTO;
import com.plf.common.exception.BusinessException;
import com.power.sifa.net.model.EqproFormTreeNode;
import com.power.sifa.net.model.GeneralBuild;
import com.power.sifa.net.model.SiteTreeBuild;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;


public interface IApl_formFeign {
    /**
     * 保存树节点
     * @param treeNode 保存树节点
     * @return
     */
    @PostMapping("/base/saveFormTreeData")
    ResponseDTO saveFormTreeData(@RequestBody EqproFormTreeNode treeNode) throws Exception;

    /**
     * 删除树节点
     * @param table 表名
     * @param sign 节点标记
     * @param id
     * @return
     */
    @PostMapping("/base/delFormTreeData")
    ResponseDTO delFormTreeData(Integer sign, String table, String id);


    /**
     * 获取下拉选择树
     * @param clsname
     * @return
     */
    @PostMapping("/base/getSelectTree")
    ResponseDTO getSelectTree(@RequestParam String clsname, @RequestBody Map<String, Object> filter) throws Exception;

    /**
     * 根据配置对象, 构建生产场地树
     * @param terrBuild
     * @return
     */
    @PostMapping("/base/buildSiteTree")
    ResponseDTO buildSiteTree(String applyid, @RequestBody SiteTreeBuild terrBuild) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    /**
     * 获取通用树组件数据
     * @param applyid 申请表id
     * @param generalBuild 通用构造对象
     * @return
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     * @throws NoSuchMethodException
     */
    @PostMapping("/base/getGeneralTree")
    ResponseDTO getGeneralTree(String applyid, @RequestBody GeneralBuild generalBuild) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException;

    /**
     * 通用树删除节点
     * @param id
     * @param apltable
     * @param enttable
     */
    @PostMapping("/base/delGeneralNode")
    ResponseDTO delGeneralNode(String applyid, String id, String apltable, @RequestParam(required = false) String enttable) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, BusinessException;

    /**
     * 保存通用树节点
     * @param apltable
     * @param enttable
     */
    @PostMapping("/base/saveGeneralNode")
    ResponseDTO saveGeneralNode(String apltable, String enttable, @RequestBody Map body) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    /**
     * 根据cornumber查询树
     */
    @PostMapping("/base/getEqTree")
    ResponseDTO getEqTree(String cornumber, @RequestBody SiteTreeBuild terrBuild) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    /**
     * 根据id查询标准信息std的值
     * @param table
     * @param ids
     * @return
     */
    @PostMapping("/base/queryStdByIds")
    ResponseDTO queryStdByIds(String table,  String ids);

    /**
     * 根据附件id查询附件
     * @param id
     * @return
     */
    @PostMapping("/base/getFile")
    ResponseDTO getFile(String id);
}
